package stattracker;
import javax.swing.*;
import java.lang.Exception;
/*
 * --------------GOALS-------------------
 * Expand, possibly add e-mail button, automatic error reporting to me
 */
@SuppressWarnings("serial")
public class ErrorMessage extends JFrame
{
	public ErrorMessage(Exception e)
	{
		e.printStackTrace();
		String message = e.getMessage()+"\n";
		for(StackTraceElement ste : e.getStackTrace())
			message += ste.toString() + "\n";
		displayPane(message);
	}
	public ErrorMessage(String error)
	{
		displayPane(error);
	}
	private void displayPane(String message)
	{
		JOptionPane.showMessageDialog(this,
			    message,
			    "System Error",
			    JOptionPane.ERROR_MESSAGE);
	}
}

